package com.zsc.wxm.ysh.anjo.house.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zsc.wxm.ysh.anjo.house.mapper.RequestLogMapper;
import com.zsc.wxm.ysh.anjo.house.model.RequestLog;
import com.zsc.wxm.ysh.anjo.house.service.RequestLogService;
import com.zsc.wxm.ysh.anjo.service.base.model.resources.vo.RequestLogVO;
import com.zsc.wxm.ysh.anjo.service.base.utils.BeanCopyUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 描述：
 *
 * @author playmaker
 * @since 2021/3/9 21:44
 */
@Service
@Slf4j
public class RequestLogServiceImpl extends ServiceImpl<RequestLogMapper, RequestLog> implements RequestLogService {
    @Override
    public List<RequestLogVO> getList(Long viewRequestId) {
        LambdaQueryWrapper<RequestLog> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(RequestLog::getViewRequestId, viewRequestId);
        List<RequestLog> list = this.list(queryWrapper);
        return BeanCopyUtil.copyListProperties(list, RequestLogVO::new);
    }
}
